
using System;
namespace cssp
{
	public enum LogLevel
	{
		None = 0, 
		Fatal,
		Error,
		Warn,
		Info,
		Debug
	}

	public interface ILogger
	{
		LogLevel LogLevel { get; set; }

		void Write(LogLevel level, string msg);
		void WriteLine(LogLevel level, string msg);
	}

	public class Log
	{
		static ILogger mLogger;

		public static ILogger Logger
		{
			get { return mLogger; }
			set { mLogger = value; }
		}

		public static void Write(LogLevel level, string msg)
		{
			if (mLogger == null)
				throw new InvalidOperationException("Logger not set.");

			mLogger.Write(level, msg);
		}

		public static void WriteLine(LogLevel level, string msg)
		{
			if (mLogger == null)
				throw new InvalidOperationException("Logger not set.");

			mLogger.WriteLine(level, msg);
		}
	}
}
